package jdkDemo;

import java.awt.Image;
import java.io.UnsupportedEncodingException;

public class Test1 {
	public static void main(String[] args) throws UnsupportedEncodingException {
		//String str=new String("abc");
		//String str2="abc";
		//String str3="abc";
		//System.out.println(str2==str3);
		//str.replace("a","x");
		//System.out.println(str);
		
		//String string="a东西";
		//byte[] bs=string.getBytes("gbk");//转码 
		//for(byte b:bs){
			//System.out.println(b);
		//}
		//String s1=new String(bs,"gbk");
		//System.out.println(s1);
		
		//System.out.println(string.charAt(1));
		
		String s="a东ahjsf,ahfk,sfbu好";
		for(int i=0;i<s.length();i++)
		{
			char c=s.charAt(i);
			if(c>='a'&&c<='z')
				System.out.println(c);
		}
		
		System.out.println("");
		StringBuffer snString=new StringBuffer();
		for(int i=0;i<s.length();i++)
		{
			char c=s.charAt(i);
			if(c>='a'&&c<='z')
				snString.append(c+"");
		}
		System.out.println(snString);
		
		char[] as=new char[s.length()];
		int count=0;
		for(int i=0;i<s.length();i++)
		{
			char c=s.charAt(i);
			if(c>='a'&&c<='z')
				as[count++]=c;
		}
		System.out.println(new String(as,0,count));
		
		String ss=" ab,d sva";
		String ar1=ss.substring(3,6);
		String[] aStrings=ss.split(",");
		String sr2=ss.trim();
		ss.indexOf("a",3);
		//建议用stringBuilder
	}
	
}
